import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import Select from '@feidao/widgets/fd-w000018';

export default async function a007(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	const v = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id="select-id"]').value;
	if (!v) {
		alert('请输入要添加的数据');
	} else {
		const s = fd.data.node.querySelector<Select>('[data-feidao-id="fd-w000018-001"]');
		s.add_data(JSON.parse(v));
	}
	fd.data.node.querySelector<HTMLTextAreaElement>('[data-feidao-id="fd-w000001-005"]').innerHTML = `const v = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id="select-id"]').value;
if (!v) {
	alert('请输入要添加的数据');
} else {
	const s = fd.data.node.querySelector<Select>('[data-feidao-id="fd-w000018-001"]');
	s.add_data(JSON.parse(v));
}`;
}
